#include "menu.h"
#include "ui_menu.h"
#include <QWidget>

game::game(QWidget *parent)
    : QWidget(parent)
    , gameui(new Ui::game)
{
    gameui->setupUi(this);
    snake snakewidget;
    // weather weatherwidget;
    // voice  musicwidget;
    // snakewidget = new snake;
    // weatherwidget = new weather;
    // musicwidget = new voice;
    connect(gameui->gamelabel,SIGNAL(doubleClicked(QWidget*)),this,SLOT(on_gamelabel_widgetshow(QWidget *)));
    connect(gameui->weatherlabel,SIGNAL(doubleClicked(QWidget*)),this,SLOT(on_weatherlabel_widgetshow(QWidget *)));
    connect(gameui->musiclabel,SIGNAL(doubleClicked(QWidget*)),this,SLOT(on_musiclabel_widgetshow(QWidget * )));
}

// void gamewidgetshow(QWidget * widget)
// {
//     widget->show();
// }

game::~game()
{
    delete gameui;
}

//游戏界面
void game::on_gamelabel_widgetshow(QWidget *  widget)
{
    qDebug() << "游戏界面已显示";
    snake *snakewidget = new snake();
    snakewidget->show();
}

//天气预报界面
void game::on_weatherlabel_widgetshow(QWidget *  widget)
{
    qDebug() << "天气预报界面已显示";
    weather *weatherwidget = new weather();
    weatherwidget->show();
}

//音乐播放器界面
void game::on_musiclabel_widgetshow(QWidget *  widget)
{
    qDebug() << "音乐播放器界面已显示";
    voice * musicwidget = new voice();
    musicwidget->show();
}

//电影播放器界面
void game::on_label_9_widgetshow(QWidget *  widget)
{

}

